package models;

import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

public class CategoryModel {
	@Id private Long id;
	
	@Unindexed private String name = "";
	
	@Unindexed private String desc = "";
	
	@Indexed private long parentId = 0;
	
	/*
	 * Parent contain all parent id form parent root to this category.
	 * Example category is Ha noi. Parent root is : Countries (id: 15) --> Vietnam (id: 256) --> Ha noi (Id: 1000)
	 * parent values is : 15,256,1000
	 */
	@Indexed private String parents = "";
	
	/*
	 * Level category, start is 1.
	 */
	@Indexed private int level = 1;
	
	@Unindexed private int count = 0;
	
	@Indexed private int status = 1; //0-Inactive, 1-Pending, 2-Active
	
	@Unindexed private Date created = new Date();
	
	@Unindexed private String keywords = "";
	
	@Unindexed private String metaDesc = "";
	
	@Indexed private String creator = ""; 
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public long getParentId() {
		return parentId;
	}

	public void setParentId(long parentId) {
		this.parentId = parentId;
	}

	public String getParents() {
		return parents;
	}

	public void setParents(String parents) {
		this.parents = parents;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getMetaDesc() {
		return metaDesc;
	}

	public void setMetaDesc(String metaDesc) {
		this.metaDesc = metaDesc;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}
	
}
